-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic state3 multisample rasterization #856
base: main
Are you sure you want to change the base?
Dynamic state3 multisample rasterization #856
Conversation
Signed-off-by: Pawel Jastrzebski <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Signed-off-by: pawel-jastrzebski-mobica <[email protected]>
Status of resolving VVL issues:
About second VL It have issue when sample count is changed (by creating new renderpass/framebuffer and invoking vkCmdSetRasterizationSamplesEXT) to other from value which have been set on pipeline creation. Is my thoughts make sense? |
After implementing dynamic rendering into that Sample I solved all previous VL issues. Unfortunately I found new one related to necessary image transition (same as was presented in dynamic_rendering sample). I checked Dynamic Rendering sample and the same issue is visible there. After resolving that on this PR I will create new one to fix it in Dynamic Rendering sample. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On startup, I get this VL error:
Validation Error: [ VUID-vkDestroyImageView-imageView-parameter ] Object 0: handle = 0x2647997b740, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xe0208096 | vkDestroyImageView(): imageView Invalid VkImageView Object 0xcdcdcdcdcdcdcdcd. The Vulkan spec states: If imageView is not VK_NULL_HANDLE, imageView must be a valid VkImageView handle (https://vulkan.lunarg.com/doc/view/1.3.275.0/windows/1.3-extensions/vkspec.html#VUID-vkDestroyImageView-imageView-parameter)
=> Would you please initialize the members of ImageData in api_vulkan_sample.h with VK_NULL_HANDLE?
When resizing or maximizing the window, I get this one:
Validation Error: [ VUID-VkFramebufferCreateInfo-pAttachments-00881 ] Object 0: handle = 0xab64de0000000020, type = VK_OBJECT_TYPE_RENDER_PASS; Object 1: handle = 0x947e98000000126c, type = VK_OBJECT_TYPE_IMAGE_VIEW; Object 2: handle = 0x4549ee000000126a, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x2ff52eec | vkCreateFramebuffer(): pCreateInfo->pAttachments[1] has VK_SAMPLE_COUNT_4_BIT samples that do not match the VK_SAMPLE_COUNT_1_BIT samples used by the corresponding attachment for VkRenderPass 0xab64de0000000020[]. The Vulkan spec states: If flags does not include VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of pAttachments must have been created with a samples value that matches the samples value specified by the corresponding VkAttachmentDescription in renderPass (https://vulkan.lunarg.com/doc/view/1.3.275.0/windows/1.3-extensions/vkspec.html#VUID-VkFramebufferCreateInfo-pAttachments-00881)
samples/extensions/dynamic_multisample_rasterization/dynamic_multisample_rasterization.cpp
Outdated
Show resolved
Hide resolved
samples/extensions/dynamic_multisample_rasterization/dynamic_multisample_rasterization.cpp
Outdated
Show resolved
Hide resolved
samples/extensions/dynamic_multisample_rasterization/dynamic_multisample_rasterization.cpp
Outdated
Show resolved
Hide resolved
samples/extensions/dynamic_multisample_rasterization/dynamic_multisample_rasterization.h
Outdated
Show resolved
Hide resolved
samples/extensions/dynamic_multisample_rasterization/dynamic_multisample_rasterization.h
Outdated
Show resolved
Hide resolved
Fix for synchronization issue was provided. |
samples/extensions/dynamic_multisample_rasterization/README.adoc
Outdated
Show resolved
Hide resolved
samples/extensions/dynamic_multisample_rasterization/README.adoc
Outdated
Show resolved
Hide resolved
samples/extensions/dynamic_multisample_rasterization/README.adoc
Outdated
Show resolved
Hide resolved
samples/extensions/dynamic_multisample_rasterization/dynamic_multisample_rasterization.cpp
Outdated
Show resolved
Hide resolved
When I start this sample, I get this error message: That is, you would need to |
Thanks for letting me know about that VL error. On which platform do you test? I didn't see that issue on ubuntu, but I will add that line and please give me feedback if that resolve your VL issue. |
Strange, I can use structs from this extension without add but when I add that line I get error because of not having that extension available on my GPU. I think something is not right, because I obviously can use features of that extension without adding it to application. |
I see that on Win10, using an NVIDIA GPU, Vulkan SDK 1.3.280. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works fine on my setup (Win 11, NV RTX 4070). Validation is clean, and changing MSAA modes has a clear visual effect. 👍🏻
I only noticed a few minor issues not directly related to the rendering part itself.
Those should be easy to fix, and once done I'll approve this :)
samples/extensions/dynamic_multisample_rasterization/README.adoc
Outdated
Show resolved
Hide resolved
samples/extensions/dynamic_multisample_rasterization/dynamic_multisample_rasterization.cpp
Show resolved
Hide resolved
samples/extensions/dynamic_multisample_rasterization/dynamic_multisample_rasterization.h
Outdated
Show resolved
Hide resolved
As stated half a year ago, you nicely sort the triangles into four different buckets, but use just two different pipelines to render them: all opaque and transparent triangles are rendered with blending enabled, even though that's only needed for the transparent ones. The same holds for the flipped triangles. Besides that, I increased the camera's rotation speed by 10. |
Hi @pawel-jastrzebski-mobica, this looks close. Can you please take a look at Andreas' comments and then resolve the merge conflicts here so we can get this merged shortly? Thanks! |
I don't know if anybody is still working on this PR. |
Overview
This sample demonstrates one of the functionalities of VK_EXT_extended_dynamic_state3 related to rasterization samples.
The extension can be used to dynamically change sampling without any need to restart the application.
Enabling the extension
To be able to use this extension in Vulkan API:
VkPhysicalDeviceExtendedDynamicStateFeaturesEXT
,VkPhysicalDeviceExtendedDynamicState2FeaturesEXT
,VkPhysicalDeviceExtendedDynamicState3FeaturesEXT
must be added to the feature chain of
VkPhysicalDeviceProperties2
andVkPhysicalDeviceExtendedDynamicState3PropertiesEXT
must be added toVkPhysicalDeviceProperties2
.Using the extension
To use the extension:
VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT
must be added toVkPipelineDynamicStateCreateInfo
.void vkCmdSetRasterizationSamplesEXT(VkCommandBuffer commandBuffer, VkSampleCountFlagBits rasterizationSamples)
should be called betweenvkCmdBeginRenderPass
andvkCmdEndRenderPass
.Known issues
The extension always reports the following validation error when enabled:
This implies several other validation errors during runtime:
Resources
https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_extended_dynamic_state3.html
https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizationSamplesEXT.html
Please ensure the following points are checked:
Note: The Samples CI runs a number of checks including: